<?php

function smarty_function_afError($params, &$smarty)
{
    $widget = $smarty->getTemplateVars("_widgetActiveForm");
    $model = $smarty->getTemplateVars("_modelForWidgetActiveForm");
    if (!$widget)
    {
        throw new CException(Yii::t('afError must be applay fot widget ActiveForm'));
    }
    $widget->error($model, $params['property']);
}